package com.ych.DemoSSM.common.util;

import javax.mail.Session;

public class SendMailThread implements Runnable {
    private String smtp;
    private String sendUser;
    private String sendPasswd;
    private String[] receivers;
    private String title;
    private String content;

    public SendMailThread(String smtp, String sendUser, String sendPasswd, String[] receivers,
                          String title, String content) {
        this.smtp = smtp;
        this.sendUser = sendUser;
        this.sendPasswd = sendPasswd;
        this.receivers = receivers;
        this.title = title;
        this.content = content;
    }

    @Override
    public void run() {
        Session session = Mail.getSession(smtp, sendUser, sendPasswd);
        Mail.send(session, sendUser, receivers, title, content);
    }

}
